package cn.com.dcsgo.springcloudstudy.order;

import cn.com.dcsgo.springcloudstudy.commons.utils.PortUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * 主启动类
 *
 * @author Dcsgo
 * @since 2024-08-06
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableCircuitBreaker//激活降级容错功能
public class OrderHystrixMain {
    public static void main(String[] args) {
        int port = PortUtil.findFreePort();
        System.out.println("Starting service on port: " + port);
        SpringApplication.run(OrderHystrixMain.class, "--server.port=" + port);
    }
}
